package com.avery.mile.hadoop.rpc;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;
import org.apache.log4j.BasicConfigurator;

import java.io.IOException;


public class MyServer {

    public static void main(String[] args) {
        BasicConfigurator.configure();
        BizServiceImpl bizService = new BizServiceImpl();
        Configuration configuration = new Configuration();
        try {
            RPC.Server server = new RPC.Builder(configuration)
                    .setInstance(bizService)
                    .setBindAddress("0.0.0.0")
                    .setProtocol(BizProtocol.class)
                    .setPort(9000)
                    .build();
            server.start();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
